<template>
  <div class="globalnav">
    <nav>
      <ul>
        <li class="logo">
        </li>
        <router-link to="/">
          <li>Home</li>
        </router-link>

        <router-link to="/user">
          <li>Mlist</li>
        </router-link>

        <router-link to="/">
          <li>Calender</li>
        </router-link>
      </ul>
      <router-link to='/users/settings'>
        <div class="user-icon">{{shourtname}}</div>
      </router-link>
    </nav>
  </div>
</template>

<script>
import {
  mapState,
} from 'vuex';

export default {
  name: 'globalnav',
  props: ['shortname'],
  computed: {
    ...mapState({
      user: state => state.user.info,
      shourtname: (state) => { debugger; return state.user.info.username == null ? '' : state.user.info.username.substr(0, 1); },
    }),
  },
};
</script>

<style lang="less" scoped>
.globalnav {
  box-shadow: 0 1px 10px;
}

nav {
  padding: 1px;
  width: 100%;
  background: -webkit-gradient(linear, 0 0, right bottom, from(rgba(0, 0, 0, .9)), to(#20a0ff));
  background-color: #20a0ff;
  display: flex;
  justify-content: space-between;
  ul {
    list-style: none;
    display: flex;
    margin: 0;
    li {
      padding: 15px 0; // min-width: 120px;
      margin: 0 35px;
    }
    a {
      text-decoration: none;
      color: white;
    }
    a:hover {
      text-shadow: 1px 1px 10px;
    }
  }
}

a {
  text-decoration: none;
}

.user-icon {
  width: 50px;
  height: 50px;
  border-radius: 10em;
  margin-right: 30px;
  line-height: 50px;
  text-transform: uppercase;
  box-shadow: inset 0 0 2px;
  color: white;
  font-size: 30px;
  overflow: hidden;
}
</style>
